#ifndef __DEBUG_PIN_H_
#define __DEBUG_PIN_H_

#include "drv_gpio.h"


#define DEBUG_PIN_1 GET_PIN(E,0)
#define DEBUG_PIN_2 GET_PIN(E,1)


static inline void DEBUG_PIN_INIT(void)
{
    rt_pin_mode(DEBUG_PIN_1, PIN_MODE_OUTPUT);
    rt_pin_mode(DEBUG_PIN_2, PIN_MODE_OUTPUT);
    rt_pin_write(DEBUG_PIN_1, RT_FALSE);
    rt_pin_write(DEBUG_PIN_2, RT_FALSE);
}

static inline void DEBUG_PIN_SET(rt_base_t pin)
{
    rt_pin_write(pin, RT_TRUE);
}

static inline void DEBUG_PIN_CLEAR(rt_base_t pin)
{
    rt_pin_write(pin, RT_FALSE);
}

static inline void DEBUG_PIN_TOGGLE(rt_base_t pin)
{
    rt_ssize_t value = rt_pin_read(pin);
    value = !value;
    rt_pin_write(pin, value);
}


#endif
